import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import {JVxeTypes,JVxeColumn} from '/@/components/jeecg/JVxeTable/types'
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '船舶名称',
    align:"center",
    dataIndex: 'vesselName'
   },
   {
    title: 'MMSI编号',
    align:"center",
    dataIndex: 'mmsi'
   },
   {
    title: 'IMO编号',
    align:"center",
    dataIndex: 'imoNumber'
   },
   {
    title: '船舶类型',
    align:"center",
    dataIndex: 'vesselType'
   },
   {
    title: '船长',
    align:"center",
    dataIndex: 'length'
   },
   {
    title: '船宽',
    align:"center",
    dataIndex: 'width'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '船舶名称',
    field: 'vesselName',
    component: 'Input',
  },
  {
    label: 'MMSI编号',
    field: 'mmsi',
    component: 'Input',
  },
  {
    label: 'IMO编号',
    field: 'imoNumber',
    component: 'Input',
  },
  {
    label: '船舶类型',
    field: 'vesselType',
    component: 'Input',
  },
  {
    label: '船长',
    field: 'length',
    component: 'InputNumber',
  },
  {
    label: '船宽',
    field: 'width',
    component: 'InputNumber',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];
//子表单数据
//子表表格配置
export const marineVesselStatusColumns: JVxeColumn[] = [
    {
      title: '船舶ID',
      key: 'vesselId',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '纬度',
      key: 'lat',
      type: JVxeTypes.inputNumber,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '经度',
      key: 'lon',
      type: JVxeTypes.inputNumber,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '航速',
      key: 'speed',
      type: JVxeTypes.inputNumber,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '航向',
      key: 'course',
      type: JVxeTypes.inputNumber,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: 'AIS状态',
      key: 'aisStatus',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
  ]
export const marineAlarmDeviceColumns: JVxeColumn[] = [
    {
      title: '设备编号',
      key: 'vsselId',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '设备名称',
      key: 'deviceName',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '设备类型',
      key: 'deviceType',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '安装位置',
      key: 'location',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '运行状态',
      key: 'status',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
  ]
export const marineWarningZoneColumns: JVxeColumn[] = [
    {
      title: '警戒区名称',
      key: 'zoneName',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '区域类型（圆形、多边形）',
      key: 'zoneType',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '中心纬度',
      key: 'centerLat',
      type: JVxeTypes.inputNumber,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '中心经度',
      key: 'centerLon',
      type: JVxeTypes.inputNumber,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '半径(米)',
      key: 'radius',
      type: JVxeTypes.inputNumber,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '警戒等级',
      key: 'level',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '多边形点集',
      key: 'polygonPoints',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '船舶ID',
      key: 'vesselId',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '是否启用',
      key: 'isActive',
      type: JVxeTypes.inputNumber,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
  ]


// 高级查询数据
export const superQuerySchema = {
  vesselName: {title: '船舶名称',order: 0,view: 'text', type: 'string',},
  mmsi: {title: 'MMSI编号',order: 1,view: 'text', type: 'string',},
  imoNumber: {title: 'IMO编号',order: 2,view: 'text', type: 'string',},
  vesselType: {title: '船舶类型',order: 3,view: 'text', type: 'string',},
  length: {title: '船长',order: 4,view: 'number', type: 'number',},
  width: {title: '船宽',order: 5,view: 'number', type: 'number',},
  //子表高级查询
  marineVesselStatus: {
    title: '船舶状态表',
    view: 'table',
    fields: {
        vesselId: {title: '船舶ID',order: 0,view: 'text', type: 'string',},
        lat: {title: '纬度',order: 1,view: 'number', type: 'number',},
        lon: {title: '经度',order: 2,view: 'number', type: 'number',},
        speed: {title: '航速',order: 3,view: 'number', type: 'number',},
        course: {title: '航向',order: 4,view: 'number', type: 'number',},
        aisStatus: {title: 'AIS状态',order: 5,view: 'text', type: 'string',},
    }
  },
  marineAlarmDevice: {
    title: '声光报警设备表',
    view: 'table',
    fields: {
        vsselId: {title: '设备编号',order: 0,view: 'text', type: 'string',},
        deviceName: {title: '设备名称',order: 1,view: 'text', type: 'string',},
        deviceType: {title: '设备类型',order: 2,view: 'text', type: 'string',},
        location: {title: '安装位置',order: 3,view: 'text', type: 'string',},
        status: {title: '运行状态',order: 4,view: 'text', type: 'string',},
    }
  },
  marineWarningZone: {
    title: '警戒区定义表',
    view: 'table',
    fields: {
        zoneName: {title: '警戒区名称',order: 0,view: 'text', type: 'string',},
        zoneType: {title: '区域类型（圆形、多边形）',order: 1,view: 'text', type: 'string',},
        centerLat: {title: '中心纬度',order: 2,view: 'number', type: 'number',},
        centerLon: {title: '中心经度',order: 3,view: 'number', type: 'number',},
        radius: {title: '半径(米)',order: 4,view: 'number', type: 'number',},
        level: {title: '警戒等级',order: 5,view: 'text', type: 'string',},
        polygonPoints: {title: '多边形点集',order: 6,view: 'text', type: 'string',},
        vesselId: {title: '船舶ID',order: 7,view: 'text', type: 'string',},
        isActive: {title: '是否启用',order: 8,view: 'number', type: 'number',},
    }
  },
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
// 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}